<table class="ui sortable table">
    <thead>
        <tr>
            <th>Date</th>
            <th>Mails Sent</th>
            <th>Badges Generated</th>
            <th>Badges Deleted</th>
            <th>Users Created</th>
            <th>Users Deleted</th>
        </tr>
    </thead>
    <tbody>
        {{#each reports as |report|}}
        <tr>
            <td data-sort-value={{extract-time-stamp report.id}}>{{sanitizeDate report.id}}</td>
            <td data-sort-value={{report.mailSentCount}}>{{report.mailSentCount}}</td>
            <td data-sort-value={{report.badgeCount}}>{{report.badgeCount}}</td>
            <td data-sort-value={{report.badgeDeletionCount}}>{{report.badgeDeletionCount}}</td>
            <td data-sort-value={{report.userCreationCount}}>{{report.userCreationCount}}</td>
            <td data-sort-value={{report.userDeletionCount}}>{{report.userDeletionCount}}</td>
        </tr>
        {{/each}}
    </tbody>
    {{#if allow}}
    <tfoot>
        <tr>
            <th colspan="12" style="text-align:center">
                <div class="ui pagination menu">

                    {{#if allowprevpage}}
                    <a class="icon item" {{action 'prevpages' }}>
                        <i class="angle double left icon"></i>
                    </a>
                    {{/if}}
                    <a class="icon item" {{action 'getPage' arrayno.[0] }}>
                        {{arrayno.[0]}}
                    </a>
                    <a class="icon item" {{action 'getPage' arrayno.[1] }}>
                        {{arrayno.[1]}}
                    </a>
                    <a class="icon item" {{action 'getPage' arrayno.[2] }}>
                        {{arrayno.[2]}}
                    </a>
                    <a class="icon item" {{action 'getPage' arrayno.[3] }}>
                        {{arrayno.[3]}}
                    </a>
                    <a class="icon item" {{action 'getPage' arrayno.[4] }}>
                        {{arrayno.[4]}}
                    </a>
                    <a class="icon item" {{action 'getPage' arrayno.[5] }}>
                        {{arrayno.[5]}}
                    </a>
                    <a class="icon item" {{action 'getPage' arrayno.[6] }}>
                        {{arrayno.[6]}}
                    </a>
                    <a class="icon item" {{action 'getPage' arrayno.[7] }}>
                        {{arrayno.[7]}}
                    </a>
                    <a class="icon item" {{action 'getPage' arrayno.[8] }}>
                        {{arrayno.[8]}}
                    </a>
                    <a class="icon item" {{action 'getPage' arrayno.[9] }}>
                        {{arrayno.[9]}}
                    </a>
                    <a class="icon item" {{action 'nextpages' }}>
                        <i class="angle double right icon"></i>
                    </a>
                </div>
            </th>
        </tr>

    </tfoot>
    {{/if}}
</table>

<script type="text/javascript">
    $('table').tablesort();
</script>
